Repository navigation
fix(plugin-grid): a list row whose click opens nothing draws no record link and no Open item - #33544
Conversation
…k face or Open item Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH
…k and no Open item The console hosts (object list, data page, interface list) pass the grid rowOpensRecord: false when the row navigation resolves to none (an authored navigation.mode none, or a list-only object), through ListView. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH
…in the row click a plain name cell hands to the row Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD Contract reviewServed-tier: Read: card #33317 (body; comments 6880998774 triage, 6885385302 claim, 6886357996 os-dev-report, 6886368569 claim amendment), PR #33544 (body, 14-file list), the net diff ① Derived judgmentsPublic surface (accept-set widening, two published types, nothing removed or narrowed):
Host computations, checked against what each host's row click actually does:
Card acceptance:
Nits (no effect on the contract):
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD 席位核对Verdict: ACCEPT · head
|
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD Landing · head
State: ready + auto-merge. |
…click opens nothing draw no pointer, and an authored none row opens no tab on a modifier click (objectstack-ai#33671) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XBJ7DmLnAJqHjfG7rG3PAw8)_ domain:ui#1 · os-project-manager · session_01FEkQ5mW5PFQoLHxgbsuizT Fixes objectstack-ai#33548 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 改了什么:列表的行点了不会打开任何东西时(视图写了 `navigation.mode: 'none'`,或对象只开放 `list`),手机卡片、画廊卡片、看板卡片不再显示手型指针和悬停浮起效果;卡片上的操作(手机卡片的「⋮」)照旧。另外,视图写了 `none` 时,⌘/Ctrl+点击或中键点击行也不再在新标签页打开记录。 - 为什么改:objectstack-ai#33317 只让表格行不像链接,同一个列表换成卡片、画廊或看板还是看起来能点,点了没反应;⌘+点击还会打开一个视图声明「不导航」的记录。 - 风险与回滚:画廊和看板各多一个可选宿主属性 `rowOpensRecord`(与表格同名),不传时与之前完全一样;能打开记录的列表(抽屉、页面)行为不变,⌘+点击照旧开新标签页;可拖动的看板卡片保留抓手光标和拖动语义;既不能拖也打不开的看板卡片不再是按钮、不占 Tab 停留位、不响应 Enter/空格。回滚即 revert 本 PR。 - 先看:`ui/packages/app-shell/src/views/objectViewRecordNavigation.ts` 的 `handleRowClick` 里新加的 `overlay.mode === 'none'` 一行;`ui/packages/plugin-list/src/ListView.tsx` 的 `ROW_OPENS_RECORD_VIEW_TYPES`;`ui/packages/plugin-kanban/src/KanbanImpl.tsx` 的 `KanbanCardsOpenRecord`。 - 两分钟验证:`pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx`,预期 21 个用例全绿。 - 需要你做的:无,席位落地。 ## What changes **Measured on `origin/main` `d95ddebc` (objectstack-ai#33544 included) before the fix**, each face on a list whose rows open nothing: | Face | Pointer / link styling on `main` | Tap on `main` | What decides it on `main` | |---|---|---|---| | Phone card (grid below 768 px) | `cursor-pointer` and `hover:bg-accent/50`, unconditional | reaches the host's `onRowClick`, which opens nothing | `ObjectGrid` `buildMobileCardRenderer`: the `data-testid="grid-mobile-card"` div's literal class string. The grid already received `rowOpensRecord` but the card never read it | | Gallery card | `cursor-pointer` plus the hover lift (`hover:shadow-lg hover:-translate-y-0.5`) | same | `ObjectGallery` `renderCard`: `(props.onCardClick \|\| props.onRowClick \|\| schema.navigation) && 'cursor-pointer'`, and `ListView` handed `rowOpensRecord` to `object-grid` only | | Board card | `cursor-pointer` on a card that cannot be dragged (`cursor-grab` on one that can), plus the hover lift | same | `KanbanImpl` `SortableCard`: `movable ? "cursor-grab active:cursor-grabbing" : "cursor-pointer"` | | ⌘/Ctrl/middle click on an authored `none` grid row | n/a | opens the record in a new tab | console `objectViewRecordNavigation` `handleRowClick` hands a modifier click to `navOverlay.handleClick`; `useNavigationOverlay` `handleClick` opens `new_window` on `event.metaKey \|\| event.ctrlKey \|\| event.button === 1` before it reads `mode === 'none'` | No face failed to reproduce, so nothing is pinned as already fixed. **The fix** (every face reads objectstack-ai#33544's `rowOpensRecord`; no second name): - **`ListView`** hands its `rowOpensRecord` to `object-grid`, `object-gallery` and `object-kanban` (`ROW_OPENS_RECORD_VIEW_TYPES`), on the same host channel objectstack-ai#33544 used for the grid. - **Phone card (`@object-ui/plugin-grid`).** `rowOpensRecord === false` drops `cursor-pointer` and the hover wash. The "⋮" stays; the click still reaches `onRowClick`, as on the desktop row. - **Gallery (`@object-ui/plugin-list`).** `ObjectGalleryProps` gains `rowOpensRecord?: boolean`; `false` drops the pointer and the hover lift. Links inside a card stay links. - **Board (`@object-ui/plugin-kanban`).** `ObjectKanbanComponentProps` gains `rowOpensRecord?: boolean`, forwarded through the internal `KanbanBoardCore` and `KanbanBoard` to every `SortableCard` by context (the way `cardsMovable` already travels). A card that cannot be dragged and opens nothing is no control at all (`control = movable || opens` false in `SortableCard`): the wrapper gets no dnd-kit attributes (no `tabindex`, `aria-roledescription` or `aria-describedby`), no `role="button"` and no `aria-label`, Enter and Space activate nothing, and the face drops the pointer, the hover lift and the `group` class that drives the title's `group-hover:text-primary`. Its click still reaches `onCardClick`, which the host routes to nothing. A draggable card keeps its grab cursor, hover and drag semantics, because a drag is still something it does. - **⌘-click (`@object-ui/app-shell`).** The card's ruling: an authored `none` row opens no record by any click. `handleRowClick` now returns on `overlay.mode === 'none'` before it reads the modifier, beside the existing list-only return. The shared `useNavigationOverlay` hook is unchanged: its `none` check sits on one line with `preventNavigation`, which card objectstack-ai#33549 owns. - Absent `rowOpensRecord` ⇒ every face is what it was. **Docs.** `plugin-list`, `plugin-kanban` and `plugin-grid` READMEs and the matching `content/docs/frontend/plugins/` pages say which faces read the prop and what they drop. **Changeset.** `.changeset/33548-card-faces-open-nothing.md` (patch for plugin-grid, plugin-list, plugin-kanban, app-shell and console). It carries a sentence superseding the pending objectstack-ai#33317 note's "still opens the record in a new tab, as before"; that note is not edited. ## Tests - **New: `ObjectView.cardFacesOpenNothing-33548.test.tsx`** (12 cases), through the real `ObjectView`, `ListView`, gallery, board and grid and the real `MePermissionsProvider`; one differential per case, only the view's `navigation`, the served operations or the edit grant differ: - gallery, authored `none` and list-only: no pointer, no hover lift; a click and a ⌘-click change no location and open no tab. CONTROL (default drawer): pointer, a click opens `?recordId=c1`, a ⌘-click opens one tab. - board, a card the reader may not drag, authored `none` and list-only: no pointer, no hover lift; click, Enter and Ctrl-click open nothing; and the card is no control: no `role="button"`, no `tabindex="0"`, no title hover. A draggable card under `none` keeps `cursor-grab`, the button role and the tab stop, and gains no pointer. CONTROL (default drawer, not draggable): pointer, button role, tab stop and title hover; Enter opens the drawer, and so does a click. - phone card (375 px), list-only: no pointer, no hover wash, the "⋮" (`grid-card-actions`) stays, a tap opens nothing. CONTROL (served object): pointer, a tap opens `/record/c1`. - **Updated: `ObjectView.rowOpensNothing-33317.test.tsx`.** The pin that expected a new tab on ⌘-click under authored `none` now expects none for ⌘, Ctrl and `button: 1`; new: a list-only object opens no tab on ⌘ or middle click; new CONTROL: the default drawer opens a tab on each of the three. A real middle click fires `auxclick`, which no row handler listens to; the pins drive `click` with `button: 1`, the shape `handleRowClick` reads. **Ablation** (legs A1b–A5 on head `98ef7bee`, leg A6 on `e22e358e`; `scripts/ablation-replace.mjs`, each leg restored to the HEAD blob with `git diff HEAD` empty; ui vitest resolves `@object-ui/*` from `src/`, so no `dist/` is in the path): | Leg | File, anchor → replacement | Pins that went red (of 18 in the two files at `98ef7bee`, 21 at `e22e358e`) | |---|---|---| | A1b phone card | `ObjectGrid.tsx` `rowOpensRecord !== false && 'cursor-pointer hover:bg-accent/50',` → `(rowOpensRecord !== false \|\| true) && …` | 1: phone card, list-only | | A2 gallery | `ObjectGallery.tsx` `const cardOpens = props.rowOpensRecord !== false;` → `Boolean(props) \|\| …` | 2: gallery authored `none`, gallery list-only | | A3b board | `KanbanImpl.tsx` `const opens = React.useContext(KanbanCardsOpenRecord)` → `true \|\| …` | 2: board authored `none`, board list-only | | A4 ListView forwarding | `ListView.tsx` `ROW_OPENS_RECORD_VIEW_TYPES.has(viewComponentSchema.type)` → the old grid-only test | 4: both gallery and both board cases | | A5 ⌘-click | `objectViewRecordNavigation.ts` `if (overlay.mode === 'none') return;` deleted | 3: the updated objectstack-ai#33317 ⌘/Ctrl/middle pin, plus gallery and board authored `none` (their ⌘/Ctrl clicks) | | A6 board control | `KanbanImpl.tsx` `const control = movable \|\| opens` → `true \|\| movable \|\| opens` | 4 failed, 17 passed: board authored `none` and list-only, both the face pins and the no-control pins | Every leg: `ablation-replace: ok mutation landed: anchor 1 -> 0`, then `ok restored: blob == HEAD … and git diff HEAD is empty`; all CONTROL cases stayed green on every leg. The first tries of A1 and A3 were refused by the tool before running (`the replacement count moved 1 -> 1` / `the anchor count moved 1 -> 1`: the replacement and anchor were substrings of each other), so they measured nothing; A1b and A3b are the rerun with distinct replacements. ## Acceptance notes - **Phone, authored `none`: rows still open the record page.** On a phone the console resolves every served object's rows to `page` "whatever the view or the object declares" (objectstack#27058's rule in `objectViewRecordNavigation`), so an authored `none` list opens records there, and its phone cards correctly keep the pointer. Probed through the real `ObjectView` at 375 px on this branch: a tap went to `/apps/setup/demo_credential/record/c1`. This contradicts the spec's "No navigation (read-only list)" and this card's ruling; it is reported to the seat as an open question, not changed here. - **Compact and capped list postures** (`ListViewCompactRows`, `ListViewCappedRows`) draw their rows as buttons / pointer rows and are not handed `rowOpensRecord`; the console's object list does not mount them. Reported to the seat, not changed. ## Verification Head `6ae0b07a` (the board-control fix `e22e358e` plus a docs rewording for the reserved-word gate). Runs on `98ef7bee` that this head does not move are kept and marked. <details><summary>Pins: 21/21 green (12 new, 9 in the updated objectstack-ai#33317 file)</summary> ```text pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx Test Files 2 passed (2) · Tests 21 passed (21) ``` </details> <details><summary>Typecheck and package suites (each under scripts/pm/os-verify-lock.sh, VERDICT command-exit 0)</summary> ```text on 6ae0b07: pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build exit 0 pnpm --filter @object-ui/plugin-kanban run type-check exit 0 pnpm --filter @object-ui/app-shell run type-check exit 0 vitest run packages/plugin-kanban/ Test Files 85 passed (85) · Tests 554 passed (554) vitest run (app-shell) src/views/ObjectView* objectViewRecordNavigation* InterfaceListPage* ObjectDataPage* src/__tests__/listKanbanEveryRecord* studio-design/StudioDesignSurface.kanbanCardSelection* Test Files 114 passed (114) · Tests 1019 passed (1019) on 98ef7be (files this head does not touch): pnpm --filter @object-ui/plugin-grid run type-check exit 0 pnpm --filter @object-ui/plugin-list run type-check exit 0 vitest run packages/plugin-list/ Test Files 173 passed (173) · Tests 1856 passed (1856) vitest run packages/plugin-grid/ Test Files 281 passed (281) · Tests 2436 passed (2436) ``` The full app-shell suite (about 75 minutes on the shared box) was narrowed to the files that mount the changed hosts and faces; CI runs it whole. </details> <details><summary>Derived gates on 6ae0b07: 69 derived, 69 run, 0 NOT-MEASURED</summary> ```text node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (69 families) every family :: exit 0 (check:role-word included: "no new occurrences of the reserved word") node scripts/pm/dispatch-gates.mjs --ran gates-ran.txt ✓ dispatch-gates --ran: 69 derived famil(ies) accounted for — 69 run, 0 NOT-MEASURED ``` </details> Also on `98ef7bee`: `pnpm --dir ui check:new-line-citations` → `0 new citation(s)`; `eslint` on the 9 touched source and test files → 0 errors, warnings only. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No spec change.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (CI runs the repo lint.) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: not touched. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the 维护者速读 block is the dispatch's required maintainer summary). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT <!-- signed: domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Requested by Leehom · project thread
domain:ui#1 · os-project-manager · session_01FEkQ5pN9UhYM1KGHApVGCH
Fixes #33317
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
navigation.mode: 'none',或只开放list的对象),表格第一列不再画成链接(没有链接颜色、下划线、锚点或链接角色),右键菜单也不再出现「打开」和「在新标签页打开」;行操作(如 Revoke)照旧。对象列表、对象数据页、界面列表页三处都生效。rowOpensRecord,不传时行为与之前完全一样,其他宿主不受影响;能打开记录的行(抽屉、页面)不变。回滚即 revert 本 PR。ui/packages/plugin-grid/src/objectGridLinkCell.tsx的opens === false分支;ui/packages/plugin-grid/src/ObjectGrid.tsx的renderRowContextMenu里rowOpensRecord两处;ui/packages/app-shell/src/views/ObjectView.tsx的rowOpensRecord: navOverlay.mode !== 'none'。pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx packages/app-shell/src/views/InterfaceListPage.rowOpensNothing-33317.test.tsx,预期 9 个用例全绿。What changes
Measured on
origin/mainf068cde8(#33441 included), through the realObjectView→ListView→ObjectGrid. The console hosts always handListViewanonRowClick, andListViewalways hands the gridonRowClick: navigation.handleClick, so the grid could not tell a row that opens nothing from one that opens a drawer. Two lines decided the face:objectGridGenerateColumns.tsxwraps the first column (and anylink: truecolumn) inLinkCellunconditionally, andRecordLinkinobjectGridLinkCell.tsxdrawsa hrefwhen the host publishes a record URL, elsespan role="link". Measured: a view authorednavigation: { mode: 'none' }on a served object draws the anchor (the host'srecordHrefanswers); a list-only object draws thespan role="link"withdata-testid="primary-field-link"(itsrecordHrefanswersnull).renderRowContextMenuinObjectGrid.tsxreadsconst opens = !!onRowClick || (navigation.mode !== 'none' && ...), so any host handler means Open. Measured: authorednoneoffersrow-context-openandrow-context-open-new-tab; list-only offersrow-context-open.The fix, the narrowest signal the order allowed: the grid cannot derive it from props it already receives (the console's resolved mode never reaches it; the grid branch of
ListViewforwards nonavigation), so one optional prop carries it, absent = today's behaviour.@object-ui/plugin-grid:ObjectGridComponentProps.rowOpensRecord?: boolean.false⇒LinkCell(new internalopensprop) draws the value in a plainspanwith the link's clamp and width only (no anchor, norole, no handler of its own, so its click falls through to the row), andrenderRowContextMenuoffers neither Open nor Open in new tab. Row actions, the actions column and fix(plugin-grid): fold a row's inline primary action into its menu while the table overflows with it #33441's inline fold are untouched.@object-ui/plugin-list:ListViewProps.rowOpensRecord?: boolean, forwarded to the grid only, on the grid's host channel besiderecordLinkAdornment(only when defined).@object-ui/app-shell(ships in@object-ui/console):ObjectViewpassesnavOverlay.mode !== 'none'(the resolved mode:nonefor authorednoneand for a list-only object viaservesRecordRead) throughuseObjectViewListRenderer;ObjectDataPagepassesrecordServed;InterfaceListPagepassesrecordAction !== 'none'.onRowClickis passed exactly as before.rowOpensRecordsections inui/packages/plugin-grid/README.md,content/docs/frontend/plugins/plugin-grid.mdxandui/packages/plugin-list/README.md..changeset/33317-row-opens-nothing-plain.md:@object-ui/plugin-grid,@object-ui/plugin-list,@object-ui/app-shell,@object-ui/consolepatch, both declaration lines.Not changed:
packages/spec, any server package,onRowClickrouting, row actions.Tests
ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx, realObjectView+ListViewgrid +MePermissionsProvider, one differential per case (same object and rows; only the view'snavigationor the served operations differ). The right-click menu is opened by acontextmenuevent on a plain cell.navigation.mode: none: the name cell holds noa[href]and no[role="link"], noprimary-field-link; the menu has no Open items and keeps Revoke.none: a ⌘-click on a plain cell still reaches the host (onewindow.open), and a ⌘-click on the now-plain name cell reaches the row too (a second one).page: the name cell is the link, the menu offers Open.ui/packages/app-shell/src/views/InterfaceListPage.rowOpensNothing-33317.test.tsx, realInterfaceListPage+ListViewgrid:recordAction: 'none'→ plain name cell; CONTROL default drawer → link.Red-first (the measurement): the eight production files restored to base
f068cde8(0 differ from base after restore), the new pins kept.base sources: 5 failed | 4 passed (9); restored: 0 bytes differ from HEAD
The ⌘-click case's first half (a plain cell, one
window.open) passed on base: the host's row routing is unchanged; only the name cell's own anchor swallowed the second click. The CONTROL cases passed on both trees.Ablations (
scripts/ablation-replace.mjs, each anchor 1 → 0, restored to the HEAD blob withgit diff HEADempty; ui vitest aliases@object-ui/*tosrc/, so no dist is in the path):six legs, each red, each restored
Acceptance notes
yes (widening). The order allowed a new optional prop when the grid cannot derive the signal; it needed one onObjectGridand one onListView(the hop between the console and the grid), both published, both optional, absent = unchanged. The claim started atno; the seat amends it.ui/packages/plugin-list/src/ListView.tsx(forwarding only) and three docs files are outside the claim's named files; they are the props that carry the signal to the grid, and the docs-driven rule inui/AGENTS.md(Coding Standards, rule 2) asks for the README and docs page.nonerow still opens a new tab. That isuseNavigationOverlay's modifier-click rule ("regardless of the configured navigation mode"), reached through the host'sonRowClick; the order says not to break what the host routes through it, so it stays, and the pin holds it. The menu's "Open in new tab" is gone for such a row, so the two now differ; a list-only row opens no tab either way.nonelist keep their pointer; only the grid is handedrowOpensRecord. Observed by reading, not measured; noted, not filed.preventNavigationon the console object list: the console'shandleRowClickwrites?recordId=for adrawerview without readingpreventNavigation, sorowOpensRecordis keyed to the resolved mode only. Observed by reading, not measured; noted, not filed.eslinton the touched files: 0 errors; theListViewforwarding line adds onereact-hooks/refswarning of the same shape its three siblingviewComponentSchema.type === 'object-grid'lines already carry.Verification
Head
a02d289c(origin/main811b976amerged in; no overlap with this diff). Local subset fromnode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, reconciled with--ran:69 derived, 69 run, all exit 0; --ran: 0 NOT-MEASURED, 0 UNRUN
Also run locally, all exit 0 under the verify lock:
pnpm --filter @object-ui/plugin-grid run type-check,@object-ui/plugin-listand@object-ui/app-shell(eachtsc --noEmit && tsc -p tsconfig.test.json, so the new tests are type-checked);pnpm --dir ui exec vitest run packages/plugin-grid/→ 281 files, 2436 passed;packages/plugin-list/→ 173 files, 1856 passed; the app-shellObjectView*,objectView*,InterfaceListPage*andObjectDataPage*files → 111 files, 986 passed; the two new pin files plusObjectView.listOnlyRecordPage-33219androwContextMenu-28434on the final head → 4 files, 36 passed.pnpm --dir ui check:new-line-citations→ 0 new. The full app-shell suite and every other family are CI's.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (touched files linted, 0 errors; the repo-wide run is CI's)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code